import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBColor/YBColor.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBImageStyle/YBImageStyle.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBTextStyle/YBTextStyle.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBUtils/YBBaseUtils/YBWeChatUtils.dart';

class YBWeChatPopPage {

 static showWeChatPopPage(BuildContext context,{String urlStr,String title, String description, String thumbNailStr}) {
    return showModalBottomSheet(context: context, builder: (BuildContext context){
       return Container(
           height: 150,
           color: YBColor.white,
           child:Padding(
              padding:EdgeInsets.only(left: 20,right: 20),
              child: Column(
                children: [
                  Container(
                    height: 20,
                  ),
                  Container(
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      crossAxisAlignment: CrossAxisAlignment.center,
                      children: [
                        Container(
                          child: Text('分享至'),
                        ),
                        Container(
                          child: InkWell(
                            child: Image.asset(YBImageStyle.getImagePath('icon_share_close')),
                            onTap: (){
                              Navigator.pop(context);
                            },
                          ),
                        ),
                      ],
                    ),
                  ),
                  Container(
                    height: 16,
                  ),
                  Container(
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceAround,
                      crossAxisAlignment: CrossAxisAlignment.center,
                      children: [
                        Container(
                          child: InkWell(
                            child: _weChatUserInfo('commonShare_wechatImage', "微信好友"),
                            onTap: () {
                              print('-微信好友--');
                               YBBaseWeChatUtils.shareWeChatLocalSession(urlStr, title:title, descirptionStr:description, thumbNailStr:thumbNailStr);
                            },
                          ),
                        ),

                        Container(
                          child: InkWell(
                            child: _weChatUserInfo('commonShare_wechatFriendImage', "朋友圈"),
                            onTap: (){
                              print('-朋友圈--');
                               YBBaseWeChatUtils.shareWeChatLocalTimeLine(urlStr,title:title,descirptionStr:description, thumbNailStr:thumbNailStr);
                            },
                          ),
                        ),
                      ],
                    ),
                  ),
                ],
              ),
           ),
       );
    });
  }

 static Widget _weChatUserInfo(String getImagePath,String title) {
      return Container(
        child: Column(
          children: [
             Container(
               child: Image.asset(YBImageStyle.getImagePath(getImagePath),width: 40,height: 40,),
             ),
             Container(
               height: 13,
             ),
             Container(
               child: Text(title,style: YBTextStyle.workTaiTitleSubText,),
             ),
          ],
        ),
      );
  }

}
